﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DataManager
{
    public partial class frmAlkalmazottak : Form
    {
        Employees m_Employees;
        
        public frmAlkalmazottak()
        {
            InitializeComponent();
            m_Employees = new Employees();
        }

        private void frmEladok_Load(object sender, EventArgs e)
        {
            FillDgvEmployee();
        }

        /// <summary>
        /// Feltolti a DataGridViewt az alkalmazottak adataival
        /// </summary>
        private void FillDgvEmployee()
        {
            dgvEmployees.Rows.Clear();
            List<Employee> employeeList = m_Employees.GetEmployeeList();
            foreach (Employee item in employeeList)
            {
                dgvEmployees.Rows.Add(item.EmployeeId, item.EmployeeName, item.Address, item.Salar, item.UserName, item.Password, item.Admin);
            }
        }

        private void btnVissza_Click(object sender, EventArgs e)
        {
            frmFo myForm = new frmFo();
            Hide();
            myForm.ShowDialog();
            Close();
        }

        private void btnKilepes_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
